import request from '@/config/axios'

export interface TenantAccountVO {
  id: number
  accountCount: number
  agentCount: number
  phoneBillCount: number
  aiAgentCount: number
  aiPhoneBillCount: number
  aiKeys: number
  aiReqCount: number
}

// 查询租户账户列表
export const getTenantAccountPage = async (params) => {
  return await request.get({ url: `/system/tenant-account/page`, params })
}

// 查询租户账户详情
export const getTenantAccount = async (id: number) => {
  return await request.get({ url: `/system/tenant-account/get?id=` + id })
}

// 新增租户账户
export const createTenantAccount = async (data: TenantAccountVO) => {
  return await request.post({ url: `/system/tenant-account/create`, data })
}

// 修改租户账户
export const updateTenantAccount = async (data: TenantAccountVO) => {
  return await request.put({ url: `/system/tenant-account/update`, data })
}

// 删除租户账户
export const deleteTenantAccount = async (id: number) => {
  return await request.delete({ url: `/system/tenant-account/delete?id=` + id })
}

// 导出租户账户 Excel
export const exportTenantAccount = async (params) => {
  return await request.download({ url: `/system/tenant-account/export-excel`, params })
}